This invention relates to data storage apparatus in which it is necessary from time to time to clear existing data items held in a store. One example of such apparatus is a cache or slave store for use in a data processing system in providing fast access to a number of data items copied from a larger but slower main store.
One way to clear items from a store is to provide each data item with a validity flag which is set to indicate that the item is valid, and reset to indicate invalidity. This avoids the necessity for physically clearing the data from the store.
In order to invalidate all the data in the store, it is necessary to reset all the validity flags, and this involves stepping through each location of the store in turn, resetting each flag individually. This can be very time consuming, especially if the store is large, and can therefore keep the store out of action for an inconveniently long time.
One solution to this problem is proposed in U.S. Pat. No. 4,053,948, in which the store is an address translation table. In that specification, whenever data is written into a location, it is tagged with a value obtained from a counter. That data is valid only while the counter retains its existing value and may be invalidated simply by incrementing the counter.
Eventually, the counter will reach its maximum count, and will then recycle through the same sequence of values. However, if there are still some data items left in the store with tags assigned during the previous cycle, they may be erroneously indicated as valid. This can be avoided, as descibed in the above mentioned specification, by causing the whole store to be invalidated when the counter recycles through zero using one of the previous methods e.g. by resetting validity flags. However, this leads back to the same problem as before, that resetting all the validity flags in the store is a very lengthy process.
One object of the present invention is to avoid this problem.